<template>
  <div style="width:100vw;" class="project-details-box">
    <!-- <div class="record-header">
      <mt-header fixed title="项目详情">
        <router-link to="/projectExperice" slot="left">
          <mt-button class="back-butt" icon="back"></mt-button>
        </router-link>
      </mt-header>
    </div>-->
    <div class="bscroll" ref="bscroll">
      <div class="bscroll-container">
        <div class="project-box">
          <div class="project-banner">
            <img src="@/assets/homePicture/detail1.jpg" alt="">
          </div>
          <div class="project-body">
            <div class="project-item flex-row">
              <div class="project-tip"><span style="padding-left:2px;" class="iconfont iconweb-icon- init-icon"></span>项目名称</div>
              <div class="project-content">{{projectDetails.projectName}}</div>
            </div>
            <div class="project-item flex-row">
              <div class="project-tip"><span class="iconfont iconkaishishijian init-icon"></span>开始时间</div>
              <div class="project-content">{{projectDetails.projectStarttime}}</div>
            </div>
            <div class="project-item flex-row">
              <div class="project-tip"><span class="iconfont iconjieshushijian init-icon"></span>结束时间</div>
              <div class="project-content">{{projectDetails.projectEndtime}}</div>
            </div>
            <div class="project-item flex-row">
              <div class="project-tip"><span style="padding-left:2px;" class="iconfont iconqiwangzhiwei init-icon"></span>项目职务</div>
              <div class="project-content">{{projectDetails.projectPost}}</div>
            </div>
          </div>
        </div>
        <div class="details">
          <div class="project-detail-tip">项目简介</div>
          <div class="project-detail-cont">{{projectDetails.projectIntroduce || '暂无'}}</div>
        </div>
        <div class="details">
          <div class="project-detail-tip">项目成果</div>
          <div class="project-detail-cont">{{projectDetails.projectAchievement || '暂无'}}</div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import BScroll from "better-scroll";
import { setText } from "../../untils/ddnavigate";
export default {
  name: "projectDetails",
  data() {
    return {
      msg: "",
      projectDetails: {}
    };
  },
  mounted() {
    let { id } = this.$route.query;
    let params = {
      id
    };
    this.$get("getProjectInfo", params).then(res => {
      if (res.success) {
        this.projectDetails = res.data;
      }
    });
    // 滚动初始化
    this.initScroll("bscroll");
    // 设置文字标题
    setText("项目详情");
  },
  methods: {
    initScroll(dom) {
      this.$nextTick(() => {
        let bscrollDom = this.$refs[dom];
        console.log(bscrollDom);
        this.aBScroll = new BScroll(bscrollDom, {
          click: true
        });
      });
    }
  }
};
</script>
<style lang="less" scoped>
@import url("~@/pagecss/projectDetails.less");
.init-icon{
  display: inline-block;
  width: 20px;
  font-weight: 700;
  margin-right: 10px;
  color: #4787e3;
}
</style>